]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
boxpointer: Handle non-widget source actors
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 29 Jun 2021 18:13:00 +0000 (20:13 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 29 Jun 2021 20:47:50 +0000 (22:47 +0200)
There is no convincing reason why source actors must be widgets,
so lift that restriction.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1903>

js/ui/boxpointer.js

index c664ae748b105edae5829b989b1e5ad68447b0fb..82d28cd834342076177733b66a583a083903bf0a 100644 (file)
@@ -464,8 +464,10 @@ var BoxPointer = GObject.registerClass({
         this._workArea = Main.layoutManager.getWorkAreaForMonitor(monitorIndex);
 
         // Position correctly relative to the sourceActor
-        let sourceNode = sourceActor.get_theme_node();
-        let sourceContentBox = sourceNode.get_content_box(sourceActor.get_allocation_box());
+        const sourceAllocation = sourceActor.get_allocation_box();
+        const sourceContentBox = sourceActor instanceof St.Widget
+            ? sourceActor.get_theme_node().get_content_box(sourceAllocation)
+            : sourceAllocation;
         let sourceTopLeft = this._sourceExtents.get_top_left();
         let sourceBottomRight = this._sourceExtents.get_bottom_right();
         let sourceCenterX = sourceTopLeft.x + sourceContentBox.x1 + (sourceContentBox.x2 - sourceContentBox.x1) * this._sourceAlignment;